package com.wlw.layoutmanager.adapters;


import com.wlw.layoutmanager.R;
import com.wlw.layoutmanager.beans.EchelonBean;

import java.util.List;


public class EchelonAdapter extends BaseAdapter<EchelonBean> {
    private int[] icons = {R.mipmap.header_icon_1, R.mipmap.header_icon_2, R.mipmap.header_icon_3, R.mipmap.header_icon_4};
    private int[] bgs = {R.mipmap.bg_1, R.mipmap.bg_2, R.mipmap.bg_3, R.mipmap.bg_4};
    private String[] nickNames = {"左耳近心", "凉雨初夏", "稚久九栀", "半窗疏影"};
    private String[] descs = {
            "回不去的地方叫故乡 没有根的迁徙叫流浪...",
            "人生就像迷宫，我们用上半生找寻入口，用下半生找寻出口",
            "原来地久天长，只是误会一场",
            "不是故事的结局不够好，而是我们对故事的要求过多",
            "只想优雅转身，不料华丽撞墙"
    };



    public EchelonAdapter(int layoutResId, List<EchelonBean> data) {
        super(R.layout.item_echelon, data);
        for (int i = 0; i < 30; i++) {
            mData.add(new EchelonBean(icons[i % 4], bgs[i % 4], nickNames[i % 4], descs[i % 5]));
        }
    }

    @Override
    public void onBindView(BaseViewHolder holder, EchelonBean echelonBean, int position) {
        holder.setTextView(R.id.tv_nickname, echelonBean.getNickName());
        holder.setTextView(R.id.tv_desc, echelonBean.getDesc());
        holder.setImageView(R.id.iv_bg, echelonBean.getBg());
        holder.setImageView(R.id.iv_icon, echelonBean.getIcon());
    }
}
